/**
 * 
 */
package car.manager;

import java.util.Calendar;
import java.util.LinkedList;

/**
 * @author joaojeronimo
 *
 */
public class Garage {

	private int id;
	private Location location;
	private int capacity;
	private String garage_name;
	private Calendar date_of_purchase;
	private int number_of_cars;
	//if I am to implement a DB, this will probably become obsolete
	private LinkedList<Car> cars;
	
	
	
	public float getMarketValue(){
		float market_value = 0;
		for(Car c:cars){
			market_value=+c.getMarket_value();
		}
		//not sure if I should add an extra to represent the garage value
		//for now, I will represent the garage market value as the sum of all its cars' market value
		return market_value;
		
	}
	
	public boolean AddCar(Car c){
		//verify stuff about the car
		return cars.add(c);
	}
	public float getOccupancyRate(){
		return number_of_cars/capacity;

	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Location getLocation() {
		return location;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

	public int getCapacity() {
		return capacity;
	}

	public void setCapacity(int capacity) {
		this.capacity = capacity;
	}

	public String getGarage_name() {
		return garage_name;
	}

	public void setGarage_name(String garage_name) {
		this.garage_name = garage_name;
	}

	public Calendar getDate_of_purchase() {
		return date_of_purchase;
	}

	public void setDate_of_purchase(Calendar date_of_purchase) {
		this.date_of_purchase = date_of_purchase;
	}

	public int getNumber_of_cars() {
		return number_of_cars;
	}

	public void setNumber_of_cars(int number_of_cars) {
		this.number_of_cars = number_of_cars;
	}

	public LinkedList<Car> getCars() {
		return cars;
	}

	public void setCars(LinkedList<Car> cars) {
		this.cars = (LinkedList<Car>) cars.clone();
	}
	
	
}
